const app = getApp()

Page({
  data: {
    item: {}
  },
  onLoad: function (options) {
    console.log(options)
    console.log(encodeURIComponent('num=JD2108261549I5X'))
    console.log(encodeURIComponent('num=JD2108131625SSK'))
    // console.log(options.scene)
    const scene = decodeURIComponent(options.scene)
    // console.log(scene)
    if (options && options.scene !== undefined) {
      console.log(111)
      this.getItem(scene)
    } else {
      console.log(222)
      this.setItem()
    }
  },
  async getItem (scene) {
    // console.log(scene)
    const res = await app.http.get('/api/v1/getZhenshu?' + scene)
    if (res.code == 0) {
      wx.setStorageSync('zs', res.data)
      this.setItem()
    } else {
      app.helper.msg(res.message)
    }
  },
  setItem () {
    const zs = wx.getStorageSync('zs')
    this.setData({ item: zs })
  },
  preview (e) {
    wx.previewImage({
      urls: [e.currentTarget.dataset.src],
    })
  },
  onShareAppMessage: function () {

  }
})